package com.yuexun.beilunpatient.ui.consult.adapter;

import android.view.View;
import android.widget.AbsListView;
import android.widget.ImageView;

import com.yuexun.beilunpatient.R;
import com.yuexun.beilunpatient.ui.consult.bean.NewsInfoBean;

import org.kymjs.kjframe.widget.AdapterHolder;
import org.kymjs.kjframe.widget.KJAdapter;

import java.util.Collection;

/**
 * Created by chenss on 2018/3/19 0019.
 */

public class ConsultListAdapter extends KJAdapter<NewsInfoBean> {

    public ConsultListAdapter(AbsListView view, Collection<NewsInfoBean> mDatas, int itemLayoutId) {
        super(view, mDatas, itemLayoutId);
    }

    @Override
    public void convert(AdapterHolder helper, NewsInfoBean item, boolean isScrolling) {
        helper.setText(R.id.title, item.getTitle());
        helper.setText(R.id.date, item.getCreateDate());
        ImageView pic = (ImageView) helper.getView(R.id.pic);

        if(item.getPictureUrl() != null && !item.getPictureUrl().isEmpty()){
//            pic.setVisibility(View.VISIBLE);
//            Glide.with(mCxt).load(qrcodeUrl).into(pic);
        }else{
            pic.setVisibility(View.GONE);
        }

    }
}
